using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using Microsoft.DirectX.DirectDraw;

namespace TowerDefense_Dx.Core
{
    public class DxScreen
    {
        protected Size _screenSize;
        public Size ScreenSize  
        {
            get { return _screenSize; }
            set { _screenSize = value; }
        }
        protected Surface _screenSurface;

        public Surface ScreenSurface
        {
            get { return _screenSurface; }
            set { _screenSurface = value; }
        }

        protected DxInitGraphics _graphics;

        public DxInitGraphics Graphics
        {
            get { return _graphics; }
            set { _graphics = value; }
        }
        protected Point _position;

        public Point Position
        {
            get { return _position; }
            set { _position = value; }
        }
        protected DxMouse _mouse;
        public DxMouse Mouse
        {
            get { return _mouse; }
            set { _mouse = value; }
        }

        public DxScreen(DxInitGraphics graphics, Size screenSize,Point position,DxMouse mouse)
        {
            _graphics = graphics;
            _screenSize = screenSize;
            _position = position;
            _mouse = mouse;
            Restore();
           
        }
        public void Restore()
        {
            SurfaceDescription desc = new SurfaceDescription();
            desc.SurfaceCaps.OffScreenPlain = true;
            desc.Width = _screenSize.Width;
            desc.Height = _screenSize.Height;
            _screenSurface = new Surface(desc, _graphics.GraphicsDevice);
        }
        public virtual void Init() { }

        public virtual void Update(double deltaTime) { }

        public virtual void Draw(double deltaTime) { }
    }
}
